package com.tarzan.oauth.feign.fallbackfactory;

import com.tarzan.oauth.feign.RemoteUserService;
import com.tarzan.oauth.feign.fallback.RemoteUserServiceFallBackImpl;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @Package com.tarzan.oauth.feign.fallbackfactory
 * @Title RemoteUserServiceFallbackFactory
 * @Description TODO
 * @Author liujinshan
 * @CreateTime 2021/7/1 15:59
 */
@Component
public class RemoteUserServiceFallbackFactory implements FallbackFactory<RemoteUserService> {
    
    /**
     * @title create
     * @description TODO
     * @param cause
     * @return com.tarzan.oauth.feign.RemoteUserService 
     * @author liujinshan
     * @data 2021/7/1 16:05
     */
    @Override
    public RemoteUserService create(Throwable cause) {
        RemoteUserServiceFallBackImpl remoteUserServiceFallBack =new RemoteUserServiceFallBackImpl();
        remoteUserServiceFallBack.setCause(cause);
        return remoteUserServiceFallBack;
    }
}
